/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yurendao.shop.forum.service;

import com.yurendao.shop.forum.domain.Comment;
import com.yurendao.shop.forum.domain.Note;
import com.yurendao.shop.forum.domain.NotePicture;
import com.yurendao.shop.forum.exception.CommentException;
import com.yurendao.shop.forum.exception.NoteException;
import com.yurendao.shop.pager.domain.Page;
import com.yurendao.shop.user.domain.User;
import java.util.List;
/**
 * @author shilin
 * 论坛模块业务层接口
 */
public interface ForumService {
  
    /**
     * 添加帖子
     * @param note
     * @throws NoteException
     */
    public void insertNote(Note note) throws NoteException;

    
    /**
     * 删除帖子
     * @param nid
     * @throws  NoteException
     */
    public void deleteNoteByNid(String nid) throws NoteException;


    /**
     * 显示帖子列表
     * @return
     * @throws NoteException
     */
    public List<Note> notelist(String orderByClause,int pageOffset) throws NoteException;

    /**
     * 根据关键字查询帖子
     * @param keyWord(包括标题，作者，省份，城市，内容)
     * @throws NoteException 
     */
    public Page<Note> selectNoteByKeyWord(String keyWord,String orderByClause,int pageOffset) throws NoteException;
    
      
    /**
     * 添加评论
     * @param comment
     * @throws CommentException
     */
    public void insertComment(Comment comment) throws CommentException;

    
    /**
     * 删除评论
     * @param  cid
     * @throws  CommentException
     */
    public void deleteCommentByCid(String cid) throws CommentException;
    
    /**
     * 显示帖子的评论
     * @param nid
     * @param orderByClause
     * @return Page<Comment>
     * @throws CommentException 
     */
    public Page<Comment> selectCommentByNote(String nid,String orderByClause,Integer pageOffset) throws CommentException;


    /**
     * 显示帖子详情
     * @param nid
     * @return
     * @throws NoteException
     */
    public Note displayNoteById(String nid) throws NoteException;

    public int getCommentCountByNoteId(String nid) throws NoteException;
}


